<?php
global $_GPC, $_W;
$GLOBALS['frames'] = $this->getMainMenu();


$data[':uniacid']=$_W['uniacid'];
$where = ' where uniacid=:uniacid';
if(isset($_GPC['keywords'])){
    $where.=" and store_name LIKE  concat('%', :name,'%')";
    $data[':name']=$_GPC['keywords'];
}
//if($_GPC['time']){
//    $start=strtotime(date('Y-m-d',strtotime($_GPC['time']['start'])));
//    $end=strtotime(date('Y-m-d',strtotime($_GPC['time']['end'])));
//    $where.=" and create_time >={$start} and create_time <={$end}";
//}
$pageindex = max(1, intval($_GPC['page']));
$pagesize=10;
$sql="select *  from " . tablename("cjdc_store_reconciliation") .$where." order by id DESC";
$select_sql =$sql." LIMIT " .($pageindex - 1) * $pagesize.",".$pagesize;
$list = pdo_fetchall($select_sql,$data);
if(!empty($list)){
    foreach ($list as $key=>$value){
        $list[$key]['update_time'] = date('Y-m-d',$value['update_time']);
    }
}
$total=pdo_fetchcolumn("select count(*) from " . tablename("cjdc_store_reconciliation") .$where,$data);
$pager = pagination($total, $pageindex, $pagesize);
include $this->template('web/reconciliation');